import spring from "@/res/spring.js";
const base_url = '/admin'

function f() {

}
function adminLogin(param={}) {
    return spring({
        url: "/user/login",
        method: 'post',
        data: param
    })

}
function allClass(param={}) {
    return spring({
        url: "/Reviewed/allClass",
        method: 'post',
        params: param
    })
}
// TODO 改接口
function getUserRole(param={}) {
    return spring({
        url: "/user/getUserRole",
        method: 'post',
        data: param
    })
}
// TODO 改接口
// 获取所有用户
function selectAll(param={}) {
    return spring({
        url: "/user/all",
        method: 'post',
        params: param
    })
}
// 获取所有审核文章
function getReviewedPosts(param={}) {
    return spring({
        url: "/Reviewed/getReviewedPosts",
        method: 'post',
        params: param
    })
}
// 获取需要审核的文章
function getNeedReviewedPosts(param={}){
    return spring({
        url: "/Blog/getBlogNotReviewed",
        method: 'post',
        params: param
    })
}

// 通过文章
function passPosts(param={}) {
    return spring({
        url: "/Reviewed/passPosts",
        method: 'post',
        params: param
    })
}
// 封禁文章
function post_banUser(param={}) {
    return spring({
        url: "/Reviewed/ban",
        method: 'post',
        params: param
    })
}
function post_upClass(param={}) {
    return spring({
        url: "/Reviewed/uploadClass",
        method: 'post',
        params: param
    })
}
function updateUser(param={}) {
    return spring({
        url: "/Reviewed/updateUser",
        method: 'post',
        data: param
    })
}
function delClass(param={}) {
    return spring({
        url: "/Reviewed/delClass",
        method: 'post',
        params: param
    })
}

// 审核通过
function passPostsAdmin(param={}) {
    return spring({
        url: "/Reviewed/passPosts",
        method: 'post',
        params: param
    })
}
// 审核未通过
function Fail(param={}) {
    return spring({
        url: "/Reviewed/Fail",
        method: 'post',
        params: param
    })
}
export {
    adminLogin,selectAll,getUserRole,allClass,post_banUser,post_upClass,getReviewedPosts,updateUser,delClass,getNeedReviewedPosts,
    passPostsAdmin,Fail

}
